#include <iostream>
#include <unordered_set>
using namespace std;

int y1, m1, d1, y2, m2, d2;
unordered_set<int> s({2, 3, 5, 7, 11});
int days[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int all_year;

bool is_leap_year(int y)
{
    return y % 4 == 0 && y % 100 != 0 || y % 400 == 0;
}

int day_distance(int m, int d1, int d2)
{
    int ans = d2 - d1 + 1;
    if (!s.count(m))
        ans *= 2;
    return ans;
}

int m_distance(int y, int m1, int d1, int m2, int d2)
{
    if (m1 == m2)
        return day_distance(m1, d1, d2);
    int tail = days[m1];
    if (m1 == 2 && is_leap_year(y))
        tail++;
    int ans = day_distance(m1, d1, tail);
    // cout << day_distance(m1, d1, tail) << endl;
    m1++;
    while (m1 != m2)
    {
        int day = days[m1];
        if (m1 == 2 && is_leap_year(y))
            ++day;
        // cout << m1 << ' ' << day << endl;
        ans += day_distance(m1, 1, day);
        // cout << day_distance(m1, 1, day) << endl;
        ++m1;
    }
    // if(m2 == 3) cout << ans << ' ' << day_distance(m1, 1, d2) << endl;
    ans += day_distance(m1, 1, d2);
    return ans;
}

int main()
{

    for (int i = 1; i <= 12; ++i)
    {
        all_year += days[i];
        if (!s.count(i))
            all_year += days[i];
    }
    // cout << all_year << endl;
    while (cin >> y1 >> m1 >> d1 >> y2 >> m2 >> d2)
    {
        int ans = 0;
        if (y1 == y2 && m1 == m2)
            ans = day_distance(m1, d1, d2);
        else if (y1 == y2)
            ans = m_distance(y1, m1, d1, m2, d2);
        else
        {
            // 不是同一年，先把当前年走完
            ans = m_distance(y1, m1, d1, 12, 31);
            y1++;
            while (y1 != y2)
            {
                ans += all_year;
                if (is_leap_year(y1))
                    ++ans;
                ++y1;
            }
            // cout << y2 << ' '  << m2 << ' ' << d2 << endl;
            ans += m_distance(y2, 1, 1, m2, d2);
        }
        cout << ans << endl;
    }
    return 0;
}